import { $get } from '@js/authRequest'
import { decomporessListLicenseAndMobileAndBank } from '@src/assets/js/tool'

// 获取数据
export async function getListRequest (params) {
  const res = await $get('/api/xapc/hearingroombook/list', params)
  if (res.status !== 1) {
    throw new Error(res.message)
  }
  return res.data
}

// 获取庭室列表
export async function getRoomListRequest () {
  const res = await $get('/api/xapc/hearingroom', {
    current: 1,
    page_size: 100000
  })
  if (res.status !== 1) {
    throw new Error(res.message)
  }
  return res.data
}

// 获取秘书列表
export async function getEmployeeListRequest () {
  const res = await $get('/api/xapc/employee/getByRoleKeys', {
    rolekeys: 'processer'
  })
  if (res.status !== 1) {
    throw new Error(res.message)
  }
  return res.data
}

// 获取仲裁员列表
export async function getArbitratorListRequest () {
  const res = await $get('/api/xapc/arbitrator', {
    current: 1,
    page_size: 100000
  })
  if (res.status !== 1) {
    throw new Error(res.message)
  }
  decomporessListLicenseAndMobileAndBank(res.data.list)
  return res.data
}
